/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package ia_psr.builder;

/**
 *
 * @author Rubén Avalos Elvira y Fabiana Celiberti Tapie
 */
import ia_psr.graph.Nodo;
import ia_psr.graph.Grafo;
import java.util.ArrayList;
public abstract class GraphBuilder implements IGraphBuilder {
    protected Grafo g;
    protected static GraphBuilder instance;

    public static GraphBuilder getInstance() {
        return null;
    }

    public void buildGraph() {
        g = new Grafo();
    }

    public void buildNode(Nodo n) {
        if (g == null)
            buildGraph();
        g.addNodo(n);
    }

    public void buildGraph(ArrayList<Nodo> nodes) {
        if (g == null)
            buildGraph();
        for (Nodo n : nodes)
            g.addNodo(n);
    }

    public Grafo getBuildedGraph() {
        if (g == null)
            buildGraph();
        return g;
    }
}
